package com.xin.ssm.service.impl;


import com.xin.ssm.bean.User;
import com.xin.ssm.dao.UserMapper;
import com.xin.ssm.service.UserServie;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserServie {


    @Autowired
    private UserMapper userMapper;
    @Autowired
    private SqlSession sqlSession;

    @Override
    public void accountMoney() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User user = mapper.queryById(1);
        return;
    }

    @Override
    public User queryById(Integer id) {
//        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
//        User user = mapper.queryById(1);
        User user = userMapper.queryById(id);
        return user;
    }
}
